package com.bzqn.baseframe;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;

abstract public class AbstructBaseActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		sp = getSharedPreferences("bzqnconfig", MODE_PRIVATE);
	}
	private SharedPreferences sp;
	public AbstructBaseActivity() {
		
	}
	public void setStringtForKey(String key, String value) {
		sp.edit().putString(key, value).commit();
	}

	public void setBooleanForKey(String key, boolean value) {
		sp.edit().putBoolean(key, value).commit();
	}

	public void setIntForKey(String key, int value) {
		sp.edit().putInt(key, value).commit();
	}

	public void setFloatForKey(String key, float value) {
		sp.edit().putFloat(key, value).commit();
	}

	public String getStringValueForKey(String key) {
		return sp.getString(key, "");
	}

	public float getFloatValueForKey(String key) {
		return sp.getFloat(key, 0.0f);
	}

	public boolean getBoleanValueForKey(String key) {
		return sp.getBoolean(key, false);
	}

	public int getIntValueForKey(String key) {
		return sp.getInt(key, 0);
	}

	abstract void onHttpRet(String content);	
}
